package com.cloud.drore.eboss.supplier.service.impl;

import com.cloud.drore.eboos.exception.BusinessException;
import com.cloud.drore.eboss.supplier.service.ICombinationProductService;
import com.cloud.drore.eboss.supplier.service.ITicketService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/4/12 10:52 <br>
 * @Author: <a href="575842778@qq.com">郑永涛</a>
 */
@Component
public class UpdateProductStatusTimer {

    @Resource
    ITicketService ticketService;
    @Resource
    ICombinationProductService combinationProductService;

    @Scheduled(cron = "0 0 1 * * ?")
    public void UpdateProductStatus() throws BusinessException {
        ticketService.updateExpiredTicket();
        combinationProductService.updateExpiredCombinationProduct();
    }
}